home *** CD-ROM | disk | FTP | other *** search
/ Aminet 44 / Aminet 44 (2001)(GTI - Schatztruhe)[!][Aug 2001].iso / Aminet / game / patch / WHDIGamesA-B.lzh / Backlash.lha / Backlash-install / Install < prev    next >
Text File  |  1999-11-12  |  3KB  |  158 lines

  1. ;****************************
  2.  
  3. (set #readme-file "README")    ;name of readme file
  4. (set #cleanup "")        ;files to delete after install
  5. (set #last-file "Disk.1")    ;last file the imager should create
  6.  
  7. ;****************************
  8. ;----------------------------
  9. ; Checks if given program is reachable via the path
  10. ; if not abort install
  11. ; IN:  #program - to check
  12. ; OUT: -
  13.  
  14. (procedure P_chkrun
  15.   (if
  16.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  17.     ("")
  18.     (abort ("You must install \"%s\" first !\nIt must be accessible via the path.\nYou can find it in the WHDLoad package." #program))
  19.   )
  20. )
  21.  
  22. ;****************************
  23.  
  24. (if
  25.   (exists #readme-file)
  26.   (if
  27.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  28.     ("")
  29.     (run ("SYS:Utilities/More %s" #readme-file))
  30.   )
  31. )
  32.  
  33. (set #program "WHDLoad")
  34. (P_chkrun)
  35.  
  36. (set #program "RawDIC")
  37. (P_chkrun)
  38.  
  39. (if
  40.   (= @user-level 2)
  41.   (
  42.     (set #CI_drive
  43.       (askchoice
  44.     (prompt "Select source drive for diskimages")
  45.     (default 0)
  46.     (choices "DF0:" "DF1:" "DF2:" "DF3:")
  47.     (help @askchoice-help)
  48.       )
  49.     )
  50.     (select #CI_drive
  51.       (set #CI_drive "DF0:")
  52.       (set #CI_drive "DF1:")
  53.       (set #CI_drive "DF2:")
  54.       (set #CI_drive "DF3:")
  55.     )
  56.     (set #ignore " IGNOREERRORS")
  57.   )
  58.   (set #CI_drive "DF0:")
  59.   (set #ignore "")
  60. )
  61.  
  62. (set @default-dest
  63.   (askdir
  64.     (prompt ("Where should \"%s\" installed ?\nA drawer \"%s\" will automatically created." @app-name @app-name))
  65.     (help @askdir-help)
  66.     (default @default-dest)
  67.     (disk)
  68.   )
  69. )
  70. (set #dest (tackon @default-dest @app-name))
  71. (if
  72.   (exists #dest)
  73.   (
  74.     (set #choice
  75.       (askbool
  76.         (prompt ("\nDirectory \"%s\" already exists.\n Should it be deleted ?" #dest))
  77.         (default 1)
  78.         (choices "Delete" "Skip")
  79.         (help @askbool-help)
  80.       )
  81.     )
  82.     (if
  83.       (= #choice 1)
  84.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  85.     )
  86.   )
  87. )
  88. (makedir #dest
  89.   (help @makedir-help)
  90.   (infos)
  91. )
  92.  
  93. ;----------------------------
  94.  
  95. (if
  96.   (exists ("%s.newicon" @app-name))
  97.   (set #icon
  98.     (askchoice
  99.       (prompt "\nWhich icon do you like to install ?\n")
  100.       (default 0)
  101.       (choices "Normal" "NewIcon")
  102.       (help @askchoice-help)
  103.     )
  104.   )
  105.   (set #icon 0)
  106. )
  107. (select #icon
  108.   (set #icon ("%s.inf" @app-name))
  109.   (set #icon ("%s.newicon" @app-name))
  110. )
  111. (copyfiles
  112.   (help @copyfiles-help)
  113.   (source #icon)
  114.   (newname ("%s.info" @app-name))
  115.   (dest #dest)
  116. )
  117. (copyfiles
  118.   (help @copyfiles-help)
  119.   (source ("%s.Slave" @app-name ))
  120.   (dest #dest)
  121. )
  122. (if
  123.   (exists #readme-file)
  124.   (copyfiles
  125.     (help @copyfiles-help)
  126.     (source #readme-file)
  127.     (dest #dest)
  128.   )
  129. )
  130. (if
  131.   (exists ("%s.info" #readme-file))
  132.   (copyfiles
  133.     (help @copyfiles-help)
  134.     (source ("%s.info" #readme-file))
  135.     (dest #dest)
  136.   )
  137. )
  138.  
  139. (copyfiles
  140.   (help @copyfiles-help)
  141.   (source ("%s.islave" @app-name))
  142.   (dest #dest)
  143. )
  144.  
  145. (run ("CD \"%s\"\nRawDIC SLAVE=%s.islave SOURCE=%s%s\nDelete %s.islave" #dest @app-name #CI_drive #ignore @app-name))
  146.  
  147. (if
  148.   (exists (tackon #dest #last-file))
  149.   ("")
  150.   (abort "Diskimaging not successful !\nRawDIC was unable to create all needed files !")
  151. )
  152.  
  153. ;----------------------------
  154.  
  155. (run ("Delete %s ALL QUIET FORCE" #cleanup))    ;delete temporary files
  156.  
  157. (exit)
  158.